package com.zkca.xf.manager;



import com.zkca.xf.model.javabean.BaiDuRouteBean;
import com.zkca.xf.model.javabean.CheckDevice;
import com.zkca.xf.model.javabean.DeviceLBean;
import com.zkca.xf.model.javabean.DeviceType;
import com.zkca.xf.model.javabean.DianLiu_Z;
import com.zkca.xf.model.javabean.FaultJobLBean;
import com.zkca.xf.model.javabean.FireAlarmBean;
import com.zkca.xf.model.javabean.FireControlBean;
import com.zkca.xf.model.javabean.JobLBean;
import com.zkca.xf.model.javabean.MesgLData;
import com.zkca.xf.model.javabean.NewsBeab;
import com.zkca.xf.model.javabean.SmokeBean;
import com.zkca.xf.model.javabean.SmsBean;
import com.zkca.xf.model.javabean.TaskLBean;
import com.zkca.xf.model.javabean.UserBean_W;
import com.zkca.xf.model.javabean.UserId;
import com.zkca.xf.model.javabean.Usermesager;
import com.zkca.xf.model.javabean.VideoiList;
import com.zkca.xf.model.javabean.Dianliu_F;
import com.zkca.xf.model.javabean.test.LoginDto;
import com.zkca.xf.model.javabean.test.Result;
import com.zkca.xf.model.javabean.upHead;
import com.zkca.xf.model.javabean.uploadbean.Dianliu_requ;
import com.zkca.xf.model.javabean.PasswordBean;
import com.zkca.xf.model.javabean.uploadbean.Mesg_UP;
import com.zkca.xf.model.javabean.uploadbean.RequestInspect;
import com.zkca.xf.model.javabean.uploadbean.RequestPage;
import com.zkca.xf.model.javabean.uploadbean.RequestSms;
import com.zkca.xf.model.javabean.uploadbean.RequestUser;
import com.zkca.xf.net.ApiManager;
import com.zkca.xf.net.RetrofitHelper;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;

/**
 * 数据处理
 * Created by yangle on 2017/6/27.
 */

public class DataManager {

    private static DataManager dataManager;
    private ApiManager retrofitService;

    public static DataManager getInstance() {
        return dataManager == null ? dataManager = new DataManager() : dataManager;
    }

    private DataManager() {
        retrofitService = RetrofitHelper.getInstance().getApiManager();
    }

   //登录
    public Observable<UserId> login(Map<String,String> map) {
        return retrofitService.login(map);
    }


  //电流
    public Observable<Dianliu_F>getDianliu(Dianliu_requ dianliu_requ){
      return retrofitService.getDianliu(dianliu_requ);
    }




    public Observable<upHead> UpHead (List<MultipartBody.Part> list){
        return retrofitService.upHead(list);
    }

    public Observable<UserId> FeedBack(Map<String,String> map){

        return retrofitService.FeedBackHttp(map);
    }



    public Observable<PasswordBean> ChangeQassword(Map<String,String> map){

        return retrofitService.ChangeQasswordHttp(map);
    }



    //消防栓
    public Observable<FireControlBean> getFireControl(Dianliu_requ dianliu_requ){
        return retrofitService.get_Fire_Control(dianliu_requ);
    }
    //火灾
    public Observable<FireAlarmBean> getFireAlarm(Map<String,String> map) {
        return retrofitService.getFireAlarm(map);
    }


    //摄像头列表
    public Observable<VideoiList> getvideoList (Map<String,String> map){
        return retrofitService.getVideoList(map);
    }


    //摄像头列表
    public Observable<BaiDuRouteBean> getBaiDuRoute(Map<String,String> map){
        return retrofitService.getBaiDuRoute(map);
    }


    //烟
    public Observable<SmokeBean> getSmoke(Map<String,String> map){
        return retrofitService.getSmoke(map);
    }
    //判断巡点是否存在
    public Observable<CheckDevice>checkDevice(Map<String,String> map){
        return retrofitService.checkDevice(map);
    }

    //上传设备图片
    public Observable<Object> UpdeviceImages (List<MultipartBody.Part> list){
        return retrofitService.upImages(list);
    }

    //上传设备信息
    public Observable<String> Updeviceinfo (Map<String,String>map){

        return RetrofitHelper.getInstance().createByString().upDevice(map);
//        return retrofitService.upDevice(map);
    }

    //电流
    public Observable<DianLiu_Z>getDianliuZ(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_DIAN_Control(dianliu_requ);
    }

    //获取验证码
    public Observable<SmsBean>getSms(RequestSms requestSms){
        return  RetrofitHelper.getInstance().createByString().get_sms(requestSms);
    }

    //验证码登录
    public Observable<UserBean_W>loginByCode(RequestUser requestUser){
        return  RetrofitHelper.getInstance().createByString().login_code(requestUser);
    }

    //火灾报警
    public Observable<String>getFireAlarm(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_FireAlarm(dianliu_requ);
    }

    //无限烟感
    public Observable<String>getSmoke(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_Smoke(dianliu_requ);
    }


    //无限烟感NB
    public Observable<String>getNBSmoke(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_NBSmoke(dianliu_requ);
    }


    //NB井盖
    public Observable<String>getNBJG(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_NBJingGai(dianliu_requ);
    }


    //智慧门禁
    public Observable<String>getZHMJ(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_ZHMJ(dianliu_requ);
    }


    //人脸识别
    public Observable<String>getRLSB(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_RLSB(dianliu_requ);
    }

    //故障电弧
    public Observable<String>getDianHu(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_DianHu(dianliu_requ);
    }

    //室内水
    public Observable<String>getShui(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_Shui(dianliu_requ);
    }

    //消防栓
    public Observable<String>getShuan(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().get_Shuuan(dianliu_requ);
    }

    public Observable<String>getDianF(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().getElectricalF(dianliu_requ);
    }

    public Observable<String>getDianG(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().getElectricalG(dianliu_requ);
    }

    //消防栓
    public Observable<String>getVideo(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().getVideo(dianliu_requ);
    }

    //巡点预添加（获取设备类型、验证是否存在）
    public Observable<DeviceType>getDvType(RequestInspect requestInspect){
        return RetrofitHelper.getInstance().createByString().getDvType(requestInspect);
    }

    //巡点添加
    public Observable<String>addDevice(RequestInspect requestInspect){
        return RetrofitHelper.getInstance().createByString().inPut(requestInspect);
    }


    //巡点查询
    public Observable<DeviceLBean>getDeviceList(RequestInspect requestInspect){
        return RetrofitHelper.getInstance().createByString().getDevList(requestInspect);
    }

    //获取任务
    public Observable<TaskLBean>getTaskList(RequestInspect requestInspect){
        return RetrofitHelper.getInstance().createByString().getTaskList(requestInspect);
    }

    //获取作业
    public Observable<JobLBean>getJobList(RequestInspect requestInspect){
        return RetrofitHelper.getInstance().createByString().getJobList(requestInspect);
    }

    //提交作业
    public Observable<JobLBean>upJob(RequestInspect requestInspect){
        return RetrofitHelper.getInstance().createByString().jobSubmit(requestInspect);
    }


    //获取故障列表
    public Observable<FaultJobLBean>GetFault(RequestInspect requestInspect){
        return RetrofitHelper.getInstance().createByString().FaultL(requestInspect);
    }


    //故障提交
    public Observable<JobLBean>FaultSubmit(RequestInspect requestInspect){
        return RetrofitHelper.getInstance().createByString().FaultSubmit(requestInspect);
    }

    //获取消息
    public Observable<MesgLData>GetMesg(Mesg_UP requestInspect){
        return RetrofitHelper.getInstance().createByString().MesgGet(requestInspect);
    }

    //提交消息回复
    public Observable<MesgLData>ReplyMesg(Mesg_UP requestInspect){
        return RetrofitHelper.getInstance().createByString().MesgReply(requestInspect);
    }


    //提交消息回复
    public Observable<Result>Login_wu(LoginDto requestInspect){
        return RetrofitHelper.getInstance().createByString().Log_Wu(requestInspect);
    }

    //提交消息回复
    public Observable<UserBean_W>Logout(RequestUser requestInspect){
        return RetrofitHelper.getInstance().createByString().logout(requestInspect);
    }
    //新闻
    public Observable<String> news(RequestPage dianliu_requ){
        return RetrofitHelper.getInstance().createByString().news(dianliu_requ);
    }

}
